package com.huisu.netty.enums;


public enum Command {
    OFFLINE(199),CONNECT(200),PRIVATE(201),GROUP(202),RADIO(203),LINERADIO(204);

    private final int code;

    Command(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static Command match(int code) {
        for (Command CommandEnum : values()) {
            if (CommandEnum.getCode() == code ) {
                return CommandEnum;
            }
        }
        return null;
    }

}
